<template>
    <div class="tab1">
        <Form :label-width="160" inline :disabled=true>
            <table style="width:100%;">
                <tr>
                    <td style="width:26%;" colspan="2">
                        <FormItem label="申请人证件号码" prop="azcp0001">
                            <Input v-model="data.azcp0001" placeholder="" @on-blur="loadExistData()"
                                   class="itemStyle"/>
                        </FormItem>
                    </td>
                    <td style="width:29%;" colspan="2">
                        <FormItem label="申请人证件类型" prop="azcp0002">
                            <dictSelect :sel_val='data.azcp0002' dictCode="certificatetype"
                                        :bindData.sync="data.azcp0002" showKeys="1" class="itemStyle"/>
                        </FormItem>
                    </td>
                    <td style="width:29%;" colspan="2">
                        <FormItem label="申请人姓名" prop="azcp0003">
                            <Input v-model="data.azcp0003" placeholder="" class="itemStyle"/>
                        </FormItem>
                    </td>
                    <td style="width:13%;" rowspan="4">
                        <img :src="data.azcp0519" alt="..." class="dbhead-img" @click="uploadPositiveImg('header')"/>
                    </td>
                </tr>
                <tr>
                    <td colspan="4">
                        <FormItem label="户籍地行政区划" prop="azdf0006">
                            <area-linkage :areaCode.sync="data.azdf0006" :countyDisable=true :streetDisable=true
                                          :communityDisable=true></area-linkage>
                        </FormItem>
                    </td>
                    <td colspan="2">
                        <FormItem label="户籍地邮政编码" prop="azdf0009">
                            <Input v-model="data.azdf0009" placeholder="" class="itemStyle"/>
                        </FormItem>
                    </td>
                </tr>
                <tr>
                    <td colspan="4">
                        <FormItem label="户籍地详细地址" prop="azdf0500">
                            <Input v-model="data.azdf0500" placeholder="" class="itemLongStyle"/>
                        </FormItem>
                    </td>
                    <td colspan="2">
                        <FormItem label="常住地邮政编码" prop="azdf0502">
                            <Input v-model="data.azdf0502" placeholder="" class="itemStyle"/>
                        </FormItem>
                    </td>
                </tr>
                <tr>
                    <td colspan="6">
                        <FormItem label="是否本市居住" prop="azdf0505">
                            <c-dict-select v-model="data.azdf0505" dictCode="yesorno" :width="180"/>
                        </FormItem>
                    </td>
                </tr>
                <tr v-if="data.azdf0505=='0'">
                    <td colspan="6">
                        <FormItem label="外市居住区划" prop="azdf0507">
                            <Ss01003Tag :bindshengjiData.sync="data.azdf0506"
                                        :bindshijiData.sync="data.azdf0507"
                                        :shengji_value="data.azdf0506"
                                        :shiji_value="data.azdf0507"
                                        style="width: 180px">
                            </Ss01003Tag>
                        </FormItem>
                    </td>
                </tr>
                <tr v-if="data.azdf0505=='1'">
                    <td colspan="4">
                        <FormItem label="常住地行政区划" prop="azdf0501">
                            <area-linkage :areaCode.sync="data.azdf0501" :countyDisable=true :streetDisable=true
                                          :communityDisable=true></area-linkage>
                        </FormItem>
                    </td>
                    <td colspan="2">
                        <FormItem label="居住地类型" prop="azdf0512">
                            <c-dict-select v-model="data.azdf0512" dictCode="live_type" :width="180"/>
                        </FormItem>
                    </td>
                </tr>
                <tr v-if="data.azdf0512=='01'&&data.azdf0505=='1'">
                    <td style="width:26%;" colspan="2">
                        <FormItem label="小区名称" prop="azdf0513">
                            <Input v-model="data.azdf0513"  class="itemStyle" maxlength="20"/>
                        </FormItem>
                    </td>
                    <td style="width:29%;" colspan="2">
                        <FormItem label="楼栋号" prop="azdf0514">
                            <Input v-model="data.azdf0514" placeholder="请输入楼栋号" class="itemStyle" maxlength="20"/>
                        </FormItem>
                    </td>
                    <td style="width:29%;" colspan="3">
                        <FormItem label="户室门牌号" prop="azdf0515">
                            <Input v-model="data.azdf0515" placeholder="请输入户室门牌号" class="itemStyle" maxlength="20"/>
                        </FormItem>
                    </td>
                </tr>
                <tr v-if="data.azdf0512=='02'&&data.azdf0505=='1'">
                    <td style="width:29%;" colspan="7">
                        <FormItem label="村小组号" prop="azdf0516">
                            <Input v-model="data.azdf0516" placeholder="请输入村小组号" class="itemStyle" maxlength="20"/>
                        </FormItem>
                    </td>
                </tr>
                <tr>
                    <td colspan="4">
                        <FormItem label="常住地详细地址" prop="azdf0008">
                            <Input v-model="data.azdf0008" placeholder="" class="itemLongStyle"/>
                        </FormItem>
                    </td>
                    <td colspan="3">
                        <FormItem label="联系人类型" prop="azdf0510">
                            <c-dict-select v-model="data.azdf0510" dictCode="contact_type" :width="180" />
                        </FormItem>
                    </td>

                </tr>
                <tr>
                    <td colspan="4">
                        <FormItem label="所属地行政区划" prop="azdf0007">
                            <area-linkage :areaCode.sync="data.azdf0007" :countyDisable=true :streetDisable=true
                                          :communityDisable=true></area-linkage>
                        </FormItem>
                    </td>
                    <td colspan="3">
                        <FormItem label="联系人姓名" prop="azdf0511">
                            <Input v-model="data.azdf0511" placeholder="请输入联系人姓名" class="itemStyle"/>
                        </FormItem>
                    </td>

                </tr>
                <tr>
                    <td colspan="2">
                        <FormItem label="是否有非保障人员" prop="ssca0087">
                            <dictSelect :sel_val='data.ssca0087' dictCode="yesorno" :bindData.sync="data.ssca0087"
                                        class="itemStyle"/>
                        </FormItem>
                    </td>
                    <td colspan="2">
                        <FormItem label="是否有赡(抚、扶)养人" prop="ssca0088">
                            <dictSelect :sel_val='data.ssca0088' dictCode="yesorno" :bindData.sync="data.ssca0088"
                                        class="itemStyle"/>
                        </FormItem>
                    </td>
                    <td colspan="3">
                        <FormItem label="联系方式" prop="azdf0011">
                            <Input v-model="data.azdf0011" placeholder="" class="itemStyle"/>
                        </FormItem>
                    </td>
                </tr>
                <tr>
                    <td colspan="7">
                        <FormItem v-if="(data.ssca0002=='101')||(data.ssca0002=='201') " label="保障标准类型" prop="ssca0079">
                            <dictSelect :sel_val='data.ssca0079' dictCode="alonemoneytype"
                                        :bindData.sync="data.ssca0079"
                                        class="itemStyle"/>
                        </FormItem>
                    </td>
                </tr>
            </table>
        </Form>
    </div>
</template>

<script>
    import dictSelect from '@/components/dictSelect/dictSelect.vue'
    import {postAction} from '@/api/request'
    import pic_header from '@/assets/images/header.jpeg'

    export default {
        name: 'application1',
        components: {
            dictSelect,
        },
        data() {
            return {
                currentTab: 0,
                familyInfo: {},
                data: {}
            }
        },
        methods: {
            edit(record) {
            },
            nextStep() {
                this.$parent.clickStep(1);
            }
        },
        mounted() {

        },
        watch: {},
        created() {
            this.familyInfo = this.$parent.familyInfo;
            //根据ss12001id 获取家庭id 和户主类型 找到ss11002信息
            var dataParam = {
                ss12001Id: this.familyInfo.ss12001Id,
                type: 'ss11'
            }
            postAction('/api/ac/subsistence/ss12001Service/getStepOneInfoReadOnly', dataParam).then((res) => {
                this.data = res.data.data
                if (this.data.azcp0519 == null || typeof (this.data.azcp0519) == 'undefined') {
                    this.data.azcp0519 = pic_header
                }
            }).finally(() => {

            })
        }
    }

</script>

<style scoped>
    .dbhead-img {
        height: 160px;
        width: 120px;
        margin-left: 10px;
    }

    /deep/ .ivu-form-item-error-tip {
        display: none;
    }

    .ivu-form-item {
        margin-bottom: 0px;
    }

    .itemStyle {
        width: 180px
    }

    .itemLongStyle {
        width: 450px
    }
</style>
